import requests

session = requests.Session()

# 模拟登录
login_url = 'https://vip.hdbz.net/auth/ajaxlogin'
login_res = session.post(login_url, data={'username': '15003884159', 'userpwd': 'Fan030311'})

# print(login_res, login_res.text, session.cookies)

# 获取收藏列表
favorite_list_url = f'https://vip.hdbz.net/site/FavoriteList?page=1&limit=10'
favorite_list_response = session.get(favorite_list_url)
for item in favorite_list_response.json()['data']:
    print(item)


# 添加收藏
add_favorite_url = 'https://vip.hdbz.net/site/ImageStore'
add_favorite_res = session.post(add_favorite_url, data={
    "aid": "179490",
    "imageurl": "/wallpaper/202510/179490.html"
})

if add_favorite_res.text ==  "100":
    print("收藏成功")
else:
    print(add_favorite_res.text)